<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>提现编辑</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">
  <link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
  <link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" />
</head>
<body class="childrenBody">
<form class="layui-form" style="width:80%;">
  <input type="hidden" id="id" name="id" value="${shopOrder.id}" />

  <div class="layui-form-item layui-row layui-col-xs12" >
    <label class="layui-form-label">兑换人</label>
    <div class="layui-input-block">
      <input type="text" class="layui-input name" disabled id="nickName" name="nickName" value="${shopOrder.memberName}" >
      <input type="hidden" id="memberId" name="memberId" value="${webMember.memberId}" >
    </div>
  </div>

  <div class="layui-form-item layui-row layui-col-xs12" >
    <label class="layui-form-label">手机号</label>
    <div class="layui-input-block">
      <input type="text" class="layui-input name" disabled id="memberPhone" name="memberPhone" value="${shopOrder.memberPhone}" >
    </div>
  </div>

  <div class="layui-form-item layui-row layui-col-xs12" >
    <label class="layui-form-label">地址</label>
    <div class="layui-input-block">
      <input type="text" class="layui-input name" disabled id="memberAddress" name="memberAddress" value="${shopOrder.memberAddress}" >
    </div>
  </div>

  <div class="layui-form-item layui-row layui-col-xs12" >
    <label class="layui-form-label">商品</label>
    <div class="layui-input-block">
      <input type="text" class="layui-input name" disabled id="itemName" name="itemName" value="${shopOrder.itemName}" >
    </div>
  </div>

  <div class="layui-form-item layui-row layui-col-xs12" >
    <label class="layui-form-label">金额</label>
    <div class="layui-input-block">
      <input type="text" class="layui-input name" disabled id="integral" name="integral" value="${shopOrder.integral}" >
    </div>
  </div>

  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">
      <span class="red"></span>&nbsp;&nbsp;图片</label>
    <div class="layui-input-block">
      <!--单图片开始-->
      <div class="layui-input-block cy-uploadpic-ctn" id="image"  style=" float:left;margin:10px 0!important;position:relative; width: 90px; height: 90px;">
      </div>
      <!--单图片结束-->
    </div>
  </div>

  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">是否处理</label>
    <div class="layui-input-block">
      <input type="radio" name="status" value="3" title="否" <#if shopOrder.status?if_exists&&shopOrder.status=='3'> checked</#if>>
      <input type="radio" name="status" value="2" title="是" <#if shopOrder.status?if_exists&&shopOrder.status=='2'> checked</#if>>
    </div>
  </div>

  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">
      &nbsp;&nbsp;备注</label>
    <div class="layui-input-block">
      <textarea class="layui-textarea" name="manageRemark" lay-verify="content" placeholder="请输入备注">${shopOrder.manageRemark}</textarea></div>
  </div>

  <div class="layui-form-item layui-row layui-col-xs12">
    <div class="layui-input-block">
      <#if shopOrder.status?if_exists&&shopOrder.status=='1'>
      <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="submitBtn">确定</button>
      </#if>
      <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary cancel">取消</button>
    </div>
  </div>
</form>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript">
    layui.use(['form', 'jquery', 'baseUtil', 'pageUtil','fileUtil','dialogUtil'],
    function() {
        var form = layui.form,
            $ = layui.jquery,
            dialogUtil = layui.dialogUtil,
            fileUtil = layui.fileUtil,
            baseUtil = layui.baseUtil,
            pageUtil = layui.pageUtil;

        fileUtil.uploadImageNoSave('image',"shop/item","${shopOrder.image}");

        form.on('submit(submitBtn)',
            function(data) {
                var field = data.field;
                var status = field.status;
                if (status == null || status == "" || status == undefined || status == "undefined") {
                    // status="3";
                    dialogUtil.alert("请选择状态");
                    return false;
                }
                var manageRemark = field.manageRemark;
                baseUtil.postMethodResult("/shopOrder/updateStatus", {id:$("#id").val(),status : status,manageRemark:manageRemark},
                    function(result) {
                        parent.location.reload();
                    });
                return false;
            });
    });
</script>
</body>
</html>